//  采购订单列表 api

import { ajaxService } from '@/utils/request';

const env = import.meta.env;
let baseURL = env.VITE_BUY_URL;

// 获取表头设置
export function getPurchaseHeader(params: any) {
  return ajaxService({
    url: '/purchase/list/header/get',
    params,
    method: 'get',
    baseURL,
  });
}

// 修改表头设置
export function PUTPurchaseHeader(data: any) {
  return ajaxService({
    url: '/purchase/list/header/edit',
    data,
    method: 'put',
    baseURL,
  });
}

// 获取列表数据
export function getPurchaseOrderList(params: any) {
  return ajaxService({
    url: '/purchase/list/order/getAll',
    params,
    method: 'get',
    baseURL,
  });
}

// 删除列表数据
export function delPurchaseOrderList(params: any) {
  return ajaxService({
    url: '/purchase/list/order/del',
    params,
    method: 'delete',
    baseURL,
  });
}

// 删除列表数据
export function postPurchaseOrder(data: any) {
  return ajaxService({
    url: '/purchase/list/order/add',
    data,
    method: 'post',
    baseURL,
  });
}

// 获取采购订单详情
export function getSinglePurchaseOrder(params: any) {
  return ajaxService({
    url: '/purchase/list/order/get',
    params,
    method: 'get',
    baseURL,
  });
}

// 获取采购订单详情
export function putSinglePurchaseOrder(data: any) {
  return ajaxService({
    url: '/purchase/list/order/edit',
    data,
    method: 'put',
    baseURL,
  });
}
